<template>
	<view>
		<view class="btmBox">
			<view v-show="reject" class="btmItem" @click="handleReject">驳回</view>
			<view v-show="argee" class="btmItem" @click="handleArgee">{{argeeText}}</view>
		</view>
		<uni-popup ref="popup" type="dialog">
			<uni-popup-dialog type="success" :title="popupTitle" @close="close" @confirm="confirm"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import uniPopupDialog from 'components/uni-popup-dialog/uni-popup-dialog.vue'
	import uniPopup from 'components/uni-popup/uni-popup.vue'
	export default {
		components: {
			uniPopup,
			uniPopupDialog
		},
		data() {
			return {
				reject: true,
				argee: true,
				argeeText: '同意',
				popupTitle: '单据已驳回'
			}
		},
		methods: {
			handleReject() {
				
				this.popupTitle = '单据已驳回'
				this.$refs.popup.open()
			},
			handleArgee() {
				if(this.argeeText === "收回") {
					this.popupTitle = '单据已收回'
				}else{
					this.popupTitle = '单据已审批'
				}
				this.$refs.popup.open()
			},
			confirm(done) {
				if(this.argeeText === '同意') {
					this.reject = false
					this.argeeText = '收回'
				}else if(this.argeeText === '收回') {
					this.reject = true
					this.argeeText = '同意'
				}
				done()
			},
		},
	}
</script>

<style lang="scss">
	.btmBox{
		position: fixed;
		left:0;
		bottom:0;
		z-index: 100;
		width:100%;
		height: 110rpx;
		line-height: 110rpx;
		// display: flex;
		// flex-direction: row;
		// justify-content: end;
		overflow: hidden;
		background-color: #FFFFFF;
		.btmItem{
			float: left;
			height: 100%;
			width: 50%;
			text-align: center;
			&:last-child{
				float: right;
				background-color: $tc;
				color: #FFFFFF;
			}
		}
	}
</style>
